*------------- Upper-Body Strength and Political Egalitarianism: Twelve Conceptual Replications ------------------------------------*
*----------------------------------------------------- STUDY 9 ---------------------------------------------------------------------*
*** Creates background variables

* Participant sex (1 = female; 2 = male)
rename V2333 sex
label define sexLB 1 "female" 2 "male"
label values sex sexLB

* Participant age
rename V2334 age





****Big Five
** Openness
egen openness = rowmean(V2350 V2351)
*Recodes to a 0-1 scale for observed min and max within sex
* Females:
summ openness if sex == 1
generate open01 = (openness-(r(min)))/(r(max)-r(min)) if sex == 1
* Males:
summ openness if sex == 2
replace open01 = (openness-(r(min)))/(r(max)-r(min)) if sex == 2

*Conscientiousness
egen conscientious = rowmean(V2352 V2353)
*Recodes to a 0-1 scale for observed min and max within sex
* Females:
summ conscientious if sex == 1
generate consc01 = (conscientious-(r(min)))/(r(max)-r(min)) if sex == 1
* Males:
summ conscientious if sex == 2
replace consc01 = (conscientious-(r(min)))/(r(max)-r(min)) if sex == 2

*Extraversion
egen extraversion = rowmean(V2354 V2355)
*Recodes to a 0-1 scale for observed min and max within sex
* Females:
summ extraversion if sex == 1
generate extra01 = (extraversion-(r(min)))/(r(max)-r(min)) if sex == 1
* Males:
summ extraversion if sex == 2
replace extra01 = (extraversion-(r(min)))/(r(max)-r(min)) if sex == 2

*Agreeable
egen agreeable = rowmean(V2356 V2357)
*Recodes to a 0-1 scale for observed min and max within sex
* Females:
summ agreeable if sex == 1
generate agree01 = (agreeable-(r(min)))/(r(max)-r(min)) if sex == 1
* Males:
summ agreeable if sex == 2
replace agree01 = (agreeable-(r(min)))/(r(max)-r(min)) if sex == 2

*Neuroticism
egen neuroticism = rowmean(V2358 V2359)
*Recodes to a 0-1 scale for observed min and max within sex
* Females:
summ neuroticism if sex == 1
generate neuro01 = (neuroticism-(r(min)))/(r(max)-r(min)) if sex == 1
* Males:
summ neuroticism if sex == 2
replace neuro01 = (neuroticism-(r(min)))/(r(max)-r(min)) if sex == 2



*** Ceates dependent variables
* Social Dominance Orientation
pwcorr V2337 V2338 V2339 V2340 V2341 V2342
alpha V2337 V2338 V2339 V2340 V2341 V2342

egen SDO6=rowmean(V2337 V2338 V2339 V2340 V2341 V2342)
generate SDO = ((SDO6-1)/6)

*Recodes to a 0-1 scale for observed min and max for males and females, respectively
summ SDO if sex == 1
generate sdo = (SDO-(r(min)))/(r(max)-r(min)) if sex == 1

summ SDO if sex == 2
replace sdo = (SDO-(r(min)))/(r(max)-r(min)) if sex == 2
bys sex: summ sdo

* Rightwing Authoritarianism
pwcorr V2343 V2344 V2345 V2346 V2347 V2348

generate rwa_1 = V2343-1
generate rwa_2 = V2344-1
generate rwa_3 = V2345-1
generate rwa_4 = V2346-1
recode V2347 (1=6) (2=5) (3=4) (4=3) (5=2) (6=1) (7=0), generate(rwa_5)
recode V2348 (1=6) (2=5) (3=4) (4=3) (5=2) (6=1) (7=0), generate(rwa_6)

pwcorr rwa_1 rwa_2 rwa_3 rwa_4 rwa_5 rwa_6
alpha rwa_1 rwa_2 rwa_3 rwa_4 rwa_5 rwa_6

egen RWA6 = rowmean(rwa_1 rwa_2 rwa_3 rwa_4 rwa_4 rwa_6)

*Recodes to a 0-1 scale for observed min and max for males and females, respectively
summ RWA6 if sex == 1
generate rwa = (RWA6-(r(min)))/(r(max)-r(min)) if sex == 1

summ RWA6 if sex == 2
replace rwa = (RWA6-(r(min)))/(r(max)-r(min)) if sex == 2

bys sex: summ rwa


** Economic Conservatism
* Renames each political issue question
rename V2364 tax_1
rename V2365 ecogap
rename V2366 immigration
rename V2367 developmentaid
rename V2368 cost_doctor
rename V2369 hard_violence
rename V2370 tax_2
rename V2371 asylum
rename V2372 retirementbenefits
rename V2373 welfare_contractout
rename V2374 localexpenditures
rename V2375 religion_public
rename V2376 health_privatehospitals
rename V2377 welfarepay_freeze
rename V2378 tax_3
rename V2379 tax_4

* Inter item correlations
pwcorr tax_1 ecogap immigration developmentaid cost_doctor hard_violence tax_2 asylum retirementbenefits ///
welfare_contractout localexpenditures religion_public health_privatehospitals welfarepay_freeze tax_3 tax_4

* Recodes items such that larger values reflect more conservative positions
recode ecogap (1=5) (2=4) (3=3) (4=2) (5=1)
recode developmentaid (1=5) (2=4) (3=3) (4=2) (5=1)
recode asylum (1=5) (2=4) (3=3) (4=2) (5=1)
recode tax_3 (1=5) (2=4) (3=3) (4=2) (5=1)

** Factor analysis to verify that items assumed to reflect economic conservatism also load on the same factor
factor tax_1 ecogap immigration developmentaid cost_doctor hard_violence tax_2 asylum retirementbenefits ///
welfare_contractout localexpenditures religion_public health_privatehospitals welfarepay_freeze tax_3 tax_4, pf

* Scree plot
scree

* Rotates factor solution
rotate, oblique oblimin
// items tax_1 ecogap tax_2 tax_3 tax_4 load on the same factor (Economic Conservatism)

* Creates scale for Economic Conservatism coded on 0-1 scale reflecting min. and max. values for males and females, respectively
alpha tax_1 ecogap tax_2 tax_3 tax_4
generate EGAL = (((tax_1+ecogap+tax_2+tax_3+tax_4)-5)/20)

summ EGAL if sex == 1
generate EconCons = (EGAL-(r(min)))/(r(max)-r(min)) if sex == 1

summ EGAL if sex == 2
replace EconCons = (EGAL-(r(min)))/(r(max)-r(min)) if sex == 2

bys sex: summ EconCons


**** Independent variables
** Self-reported physical strength relative to others
generate phys_strength = (V2362-1)/6


** Physiological measures of physical strength
* Biceps circumference
summ Biceps

* Chest circumference
clonevar Chest = Bryst
summ Chest

* Dynamometer - standard exercise (uses largest value across two trials)
egen Dynamometer = rowmax(Dynamometer_1 Dynamometer_2)

* Dynamometer - reversed exercise (uses largest value across two trials)
egen Reversed_Dynamo = rowmax(Omvendt_dynamo_1 Omvendt_dynamo_2)

** Creates composite formidability measure on 0-1 scale reflecting min. and max. values for males and females, respectively
pwcorr Biceps Chest Dynamometer Reversed_Dynamo phys_strength, sig
alpha Biceps Chest Dynamometer Reversed_Dynamo phys_strength

factor Biceps Chest Dynamometer Reversed_Dynamo phys_strength, pcf
predict physstrength

summ physstrength if sex == 1
generate physmorph_factor = (physstrength-(r(min)))/(r(max)-r(min)) if sex == 1

summ physstrength if sex == 2
replace physmorph_factor = (physstrength-(r(min)))/(r(max)-r(min)) if sex == 2

** Creates formidability measure WITHOUT self-report on 0-1 scale reflecting min. and max. values for males and females, respectively
factor Biceps Bryst Dynamometer Reversed_Dynamo, pcf
predict formidability

summ formidability if sex == 1
generate formidability01 = (formidability-(r(min)))/(r(max)-r(min)) if sex == 1

summ formidability if sex == 2
replace formidability01 = (formidability-(r(min)))/(r(max)-r(min)) if sex == 2


*-----------------------------------------------------------------DESCRIPTIVES-----------------------------------------------------------------*
summ age
tab sex

*Formidability
bys sex: summ physmorph_factor if age!=.

*SDO
alpha V2337 V2338 V2339 V2340 V2341 V2342 if physmorph_factor !=. & age!=.
bys sex: summ sdo if physmorph_factor !=. & age!=.

*Econ. Cons.
alpha tax_1 ecogap tax_2 tax_3 tax_4 if physmorph_factor !=. & age!=.
bys sex: summ EconCons if physmorph_factor !=. & age!=.

*RWA
alpha V2343 V2344 V2345 V2346 V2347 V2348 if physmorph_factor !=. & age!=.
bys sex: summ rwa if EconCons !=. & age!=.

*-----------------------------------------------------------ANALYSER Physical strength---------------------------------------------------------*


***Physmorp_factopr som predictor af psykologiske prædispositioner og holdninger, for alle subejcts og kønsopdelt:
****SDO
**Only females
reg sdo c.physmorph_factor age if sex == 1
eststo female

**Only males
reg sdo c.physmorph_factor age if sex == 2
eststo male

**Interaction strength X sex
reg sdo c.physmorph_factor##i.sex age
eststo all_subjects



****RWA
**Only females
reg rwa c.physmorph_factor age if sex == 1
eststo female

**Only males
reg rwa c.physmorph_factor age if sex == 2
eststo male

**Interaction strength X sex
reg rwa c.physmorph_factor##i.sex age
eststo all_subjects




****Egalitarisme
**Only females
reg EconCons c.physmorph_factor age if sex == 1
eststo female

**Only males
reg EconCons c.physmorph_factor age if sex == 2
eststo male

**Interaction strength X sex
reg EconCons c.physmorph_factor##i.sex age
eststo all_subjects




****Robustness analyses using formidability measure that does not include self-reported strength
****SDO
**Only females
reg sdo c.formidability01 age if sex == 1

**Only males
reg sdo c.formidability01 age if sex == 2


****RWA
**Only females
reg rwa c.formidability01 age if sex == 1

**Only males
reg rwa c.formidability01 age if sex == 2


****Egalitarisme
**Only females
reg EconCons c.formidability01 age if sex == 1

**Only males
reg EconCons c.formidability01 age if sex == 2





*-------------------------Does SDO mediate the effect of physical strength on political attitudes, ideolgoy and party choice?---------------------------*
**Only Males
*STI: Fysisk styrke --> SDO --> Egalitarianism
sem (age physmorph_factor -> sdo if sex==2) ///
	(age physmorph_factor sdo -> EconCons), nocapslatent
	
estat teffects
estat gof, stats(all)


**Only FEMALES
*STI: Fysisk styrke --> SDO --> Egalitarianism
sem (age physmorph_factor -> sdo if sex==1) ///
	(age physmorph_factor sdo -> EconCons), nocapslatent
	
estat teffects
estat gof, stats(all)



**** -------------------Analyses controlling for Big Five personality measures -----------------------------------*****
*** Predictions of SDO
* Only females
reg sdo c.physmorph_factor age if sex == 1
reg sdo c.physmorph_factor age open01 consc01 extra01 agree01 neuro01 if sex == 1

* Only males
reg sdo c.physmorph_factor age if sex == 2
reg sdo c.physmorph_factor age open01 consc01 extra01 agree01 neuro01 if sex == 2

*** Predictions of egalitarianism
* Only females
reg EconCons c.physmorph_factor age if sex == 1
reg EconCons c.physmorph_factor age open01 consc01 extra01 agree01 neuro01 if sex == 1

* Only males
reg EconCons c.physmorph_factor age if sex == 2
reg EconCons c.physmorph_factor age open01 consc01 extra01 agree01 neuro01 if sex == 2
